#ifndef DBMOCK_H
#define DBMOCK_H

#include <vector>
#include <utility>
#include <string>
#include "article.h"
#include "dbinterface.h"

using namespace std;

class dbmock: public dbinterface{
	public:
	/*
	Constructor
	*/
	dbmock();
	
	/*	
	Destructor
	*/
	~dbmock();
	/*
	Returns a vector of pairs of int and string. Contains three posts with firs = {1,2,3},
	second =  {"test1", "test2", "test3"}.
	*/
	vector<pair<int, string>> listnewsgroups() override;
	
	/*
	Returns true if name = "true", false otherwise
	*/
	bool createnewsgroup(string name) override;
	
	/*
	Returns false if groupid = 0, true otherwise
	*/
	bool deletenewsgroup(int groupid) override;

	/*
		Returns a vector with a pair(id, "test") if id != 0, an empty list otherwise
	*/
	vector<pair<int, string>> listarticles(int id) override;

	/*
	Returns false if groupid = 0, true otherwise
	*/
	bool createarticle(int groupid, string title, string author, string text) override;
	
	/*
	Returns 1 if groupid == 0, 2 if articleid == 0 (groupid != 0), 0 otherwise
	*/
	int deletearticle(int groupid, int articleid) override;
	/*
	Returns pair(0, article(1,"title","author","text")) if groupid != 0 and articleid != 0, pair(1, ___) if groupid = 0,
	pair(2, ___) if articleid = 0;
	*/
	pair<int, article> getarticle(int groupid, int articleid) override;
	
};
#endif
